//
//  SYRequestAPI+Teach.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/5/8.
//  Copyright © 2019 SanYi. All rights reserved.
//
//资源
NSString *const TEACH_LessonResource_URL = @"teach/CourseService.svc/GetLessonResourceByAttendProgressId";

NSString *const TEACH_CountByQuestionDetail_URL = @"teach/HomeWordService.svc/CountByQuestionDetail";

NSString *const TEACH_AnsweredPaperDetail_URL =@"paper/StatisticsService.svc/AnsweredPaperDetail";
NSString *const TEACH_ClassLessonAttendList_URL =@"teach/ClassService.svc/ClassLessonAttendList";
NSString *const TEACH_AnsweredQuestionDetail_URL = @"paper/StatisticsService.svc/AnsweredQuestionDetail";
NSString *const TEACH_ClassStudent_Search_URL = @"common/CommonService.svc/ClassStudent";
#import "SYRequestAPI+Teach.h"

@implementation SYRequestAPI (Teach)
+ (void)sy_getUnAttend:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_UnAttend_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"未上课时 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getAttend:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_Attend_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"已上课时 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
//申请资源
+ (void)sy_postResourceApplyGroupId:(NSString *)gorupid
                           campusId:(NSString *)campusId
                   attendProgressId:(NSString *)attendProgressId
                           lessonId:(NSString *)lessonId
                        applyReason:(NSString *)applyReason
                            success:(void(^)(BOOL isSuccess))success
                               fail:(FailBlock)fail
{
    NSDictionary *dict = @{
                           @"attendProgressId":attendProgressId
                        };
    
    NSString *url = @"teach/CourseService.svc/ResourceApply";
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:dict success:^(id responseObject) {
        if (success) {
            success(YES);
        }
    } fail:^(NSError *error) {
        if (fail) {
            fail(error);
        }
    }];
    
    
}
+ (void)sy_getLessonDetail:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_LessonDetail_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-课程-上课时-课时详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassStudent:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_ClassStudent_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-课程-未上课时-课程学生 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getLessonStudent:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_LessonStudent_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-课程-已上课时-课程学生 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}

+ (void)sy_getHomeWordServiceHomeWorKList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_HomeWordService_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getHandList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_HandList_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业-上交详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getHomeWordServiceHomeWorKDetail:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_HomeWorKDetail_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业-作业详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getHomeWordServiceCountByStudentList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_CountByStudentList_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业-作业详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getHomeWordServiceCountByQuestionList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_CountByQuestionList_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业-作业详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceClassList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_ClassList_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-班级列表 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceClassDetail:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_ClassDetail_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-班级列表 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceClassStudentList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_ClassStudentList_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-班级列表 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceClassAttendList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_ClassAttendList_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-班级考勤 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceClassLessonList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_ClassLessonList_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-班级考勤 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceClassAttendDetailList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_ClassAttendDetailList_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-班级考勤-考勤详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceClassStudentDetail:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    [SYRequestAPI postDataFromURLScheme:TEACH_ClassStudentDetail_URL parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-班级考勤-考勤详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceLessonResource:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = TEACH_LessonResource_URL;
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-资源 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceHomeWorKDetail:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = TEACH_HomeWorKDetail_URL;
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业-试卷详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceCountByQuestionDetail:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = TEACH_CountByQuestionDetail_URL;
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业-试题详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}

+ (void)sy_getClassServiceStatisticsByStudent:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = TEACH_AnsweredPaperDetail_URL;
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业-按学生统计详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceClassLessonAttendList:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = TEACH_ClassLessonAttendList_URL;
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-班级-课时考勤详情 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getClassServiceAnsweredQuestionDetail:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = TEACH_AnsweredQuestionDetail_URL;
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"教学-作业-做题的s学生 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
//带查询的班级学生
+ (void)sy_getClassServiceClassStudent:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = TEACH_ClassStudent_Search_URL;
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"带查询的班级学生 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
@end
